// 导入封装的axios
import axios from "@/utils/http";
// 导入封装的接口地址
import * as baseURL from "@/api/url";

// 添加护理人员的接口
export const addNurseAPI = (data) => {
    return axios({
        url: baseURL.nurse_add_url,
        method: "post",
        data,
    });
};

// 搜索护理人员
export const getNurseByPageAPI = (params) => {
    return axios({
        url: baseURL.nurse_get_url,
        method: "get",
        params,
    });
};

//修改护理人员
export const editNurseInfoAPI = (data) => {
    return axios({
        url: baseURL.nurse_edit_url,
        method: "post",
        data
    })
}

//删除护理人员
export const deleteNurseByIdAPI = (data) => {
    return axios({
        url: baseURL.nurse_delete_url,
        method: "post",
        data
    })
}
//查询护理人员个人信息
export const getNurseByUsernameAPI = (params) => {
    // 使用实际的 adminno 替换URL模板中的占位符
    const url = baseURL.nurse_personal_get_url.replace(':nurseno', params.nurseno);
    return axios({
      url: url,
      method: 'get',
      params: params,
    });
  };
//查询护理人员自己所属老人的信息
export const getElderByNurseId = (params) => {
    // 使用实际的 adminno 替换URL模板中的占位符
    const nurseurl="http://localhost:8080/elder/query2/:nurseid"
    const url = nurseurl.replace(':nurseid', params.nurseid);
    return axios({
      url: url,
      method: 'get',
      params: params,
    });
  };